﻿//using System;
//using System.Collections.Generic;
//using System.Linq;
//using System.Text;
//using System.Threading.Tasks;

//namespace VIA.SiMoJi.Domain.SoftPLC
//{
//    public static class MainProcedure
//    {
//        public static Dictionary<int, BitDataRegister> In_Register => IOLable.In_PiyshicalBitDataRegisters;
//        public static Dictionary<int, BitDataRegister> Out_Register => IOLable.Out_PiyshicalBitDataRegisters;
//        public static Dictionary<string, BitDataRegister> Vir_Register => IOLable.Vir_BitDataRegisters;
//        public static Instruction AutoRunReady { get; set; } = new("自动运行就绪标志");
//        public static Instruction Alarm { get; set; } = new("报警标志");

//        public static void Init()
//        {
//            IOLable.AddVirBitDataRegister(1, AutoRunReady.Annotation);
//            IOLable.AddVirBitDataRegister(2, Alarm.Annotation);
//        }

//        public static void InitAutoRunReady()
//        {
//            AutoRunReady.OutPutNode = new BitOupPut(Vir_Register[AutoRunReady.Annotation]);
//            AutoRunReady.AddNodes(new NormalClose(Vir_Register[Alarm.Annotation]));
//            AutoRunReady.AddNodes(new NormalClose(In_Register[2]));
//            AutoRunReady.AddNodes(new NormalClose(In_Register[3]));
//            AutoRunReady.AddNodes(new NormalClose(In_Register[4]));
//            AutoRunReady.AddNodes(new NormalOpen(In_Register[5]));
//        }

//        public static void InitAlarm()
//        {
//            Alarm.OutPutNode = new BitOupPut(Vir_Register[Alarm.Annotation]);
//            var block = new ParallelBlock();
//            block.AddNodes(new NormalOpen(In_Register[06]));
//            block.AddNodes(new NormalOpen(In_Register[07]));
//            block.AddNodes(new NormalOpen(In_Register[08]));
//            block.AddNodes(new NormalOpen(In_Register[09]));
//            block.AddNodes(new NormalOpen(In_Register[10]));
//            block.AddNodes(new NormalOpen(In_Register[11]));
//            block.AddNodes(new NormalOpen(In_Register[12]));
//            block.AddNodes(new NormalOpen(In_Register[13]));
//            block.AddNodes(new NormalOpen(In_Register[14]));
//            block.AddNodes(new NormalOpen(In_Register[15]));
//            block.AddNodes(new NormalOpen(In_Register[16]));
//            block.AddNodes(new NormalOpen(In_Register[17]));
//            block.AddNodes(new NormalOpen(In_Register[18]));
//            Alarm.AddNodes(block);
//        }
//    }
//}
